﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Littlebeer.DataSource
{
    public class SqlClientDataSource
    {
        public static System.Data.DataTable ToTable(string oledbConnectionString, string sql)
        {
            DataTable result = new DataTable();

            SqlConnection cn = new SqlConnection(oledbConnectionString);
            SqlDataAdapter da = new SqlDataAdapter(sql, cn);
            DataSet ds = new DataSet();
            da.Fill(ds, "LoadTable");
            result = ds.Tables["LoadTable"];
            return result;
        }
    }
}
